#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int x,y;
	cin>>x>>y;
	int i=x;
	while(1){
		if(x%i==0 && y%i==0){
			break;
		}
		i--;
	}
	cout<<i<<endl;
	i=y;
	while(1){
		if((x*i)%y==0 && (y*i)%x==0){
			int y=x*i;
			break;
		}
		i++;
	}
	cout<<y;
}
